#!/bin/bash
case $(cat /etc/issue | cut -f 1 -d ' ') in
'Arch') INSTALL() { sudo pacman -S $@; } ;;
'Ubuntu') INSTALL() { sudo apt install $@ -y --allow-unauthenticated; } ;;
*) echo 'Your distribution has not implementd yet, please modify this command' ;;
esac
if [ $(which wget | wc -l) == 0 ]; then INSTALL wget; fi
if [ $(which python | wc -l) == 0 ]; then INSTALL python; fi

sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.py | sudo python -c "import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main()"
